package com.tgy.ProxyPlus;

import com.tgy.demo2.UserService;
import com.tgy.demo2.UserServiceImpl;

/***
 * @ClassName: Client
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 16:26 2021/12/17
 * @version : V1.0
 */
public class Client {
    public static void main(String[] args) {
        //真实对象
        UserServiceImpl userService = new UserServiceImpl();
        //动态生成代理对象
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        pih.setTarget(userService);
        //代理对象
        UserService proxy = (UserService)pih.getProxy();
        proxy.add();

    }
}
